//输入框
var input = document.querySelectorAll('input')

//按钮
var button = document.querySelector('button')


//绑定事件
button.onclick = function () {
    axios.post('/user/login', { phone: input[0].value, pass: input[1].value }).then((res) => {
        // console.log(res, data);
        if(res.data.code==200){
            localStorage.setItem('userinfo',JSON.stringify(res.data.userinfo))
       alert('登陆成功')
       location.href='./index.html'
        }else{
            alert('登陆失败')
        }
    })
}